package commands;

import nanoxml.XMLElement;
import utils.ITransmittable;

/**
 * This command represents a reply from the DB to the
 * client who tried to login stating that his details
 * are correct.
 */
public class CommandUserVerified implements ITransmittable {

	private final String ATTR_USER_NAME = "Username";
	
	private String username = null; 
	
	public CommandUserVerified (String username) {
		this.username = username;

	}
	public CommandUserVerified (XMLElement command) {
		this.username = (String) command.getAttribute(ATTR_USER_NAME);
	}
	
	@Override
	public XMLElement toXML() {
		XMLElement message  = new XMLElement();
		message.setName( Commands.USER_VERIFIED);
		message.setAttribute(ATTR_USER_NAME, username);
		
		return message;
	}
	
	public String getUsername()
	{
		return username;
	}
}
